package com.kyle.cyledemomebius.controller;

import com.kyle.cyledemomebius.service.AsyncService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Slf4j
@RestController
@RequestMapping("/asyncTest")
public class AsyncController {

    @Resource
    private AsyncService asyncService;


    // http://localhost:8089/asyncTest/run
    @RequestMapping("/run")
    public String testAsync( ) {
        System.out.println("test begin");

        asyncService.asyncMethod();

        System.out.println("never stopped by the method between them!!");
        return "testAsync made it >>>> " ;

    }
    @RequestMapping("/walk")
    public String testMebius( ) {
        System.out.println("test begin");

        asyncService.mebiusMethod();

        return "testMebius, made it >>>> " ;

    }

}
